package xio.ccf_201509;

import java.util.Scanner;

/**
 * ccf 201509-1	数列分段  100分
 * @author Xio
 *
 */
public class DataDivision {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int preK = -1;
		int result = 0;
		for(int i = 0;i<n;i++) {
			int k = sc.nextInt();
			
			if(k == preK) {
				continue;
			}
			preK = k;
			result++ ;
				
		}
		System.out.println(result+"");

		
	}

}
